﻿////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// <copyright>Copyright 2008-2011 Andreas Huber Doenni</copyright>
// Distributed under the Microsoft Public License (Ms-PL).
// See accompanying file License.txt or copy at http://mews.codeplex.com/license.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

namespace Mews.Mime
{
    using System.Diagnostics.CodeAnalysis;

    /// <summary>Exposes the information contained in the Content-Disposition header field, see
    /// <a href="http://www.ietf.org/rfc/rfc2183.txt">RFC 2183</a>.</summary>
    /// <threadsafety static="true" instance="false"/>
    public sealed class Disposition
    {
        private readonly DispositionKind kind;
        private readonly string fileName;

        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////

        /// <summary>Initializes a new instance of the <see cref="Disposition"/> class.</summary>
        /// <param name="kind">The disposition kind.</param>
        /// <param name="fileName">The file name, pass <c>null</c> to not specify a file name.</param>
        public Disposition(DispositionKind kind, string fileName)
        {
            this.kind = kind;
            this.fileName = fileName;
        }

        /// <summary>Gets the disposition type.</summary>
        public DispositionKind Kind
        {
            get { return this.kind; }
        }

        /// <summary>Gets the file name.</summary>
        /// <value>The file name; or <c>null</c> when the disposition does not specify a filename.</value>
        public string FileName
        {
            get { return this.fileName; }
        }
    }
}
